//
//  ViewController.m
//  register
//
//  Created by dllo on 16/6/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "button.h"
#import "Button1.h"
@interface ViewController ()<UITextFieldDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self viewText];
    [self creaButtons];
}
-(void)viewText{
    UITextField *text1 =[[UITextField alloc]initWithFrame:CGRectMake(100, 100, 100, 50)];
    text1.text = @"用户名";
    [self.view addSubview:text1];
    UITextField *text2 =[[UITextField alloc]initWithFrame:CGRectMake(100, 150, 100, 50)];
    text2.text = @"密码";
    [self.view addSubview:text2];
    UITextField *text3 =[[UITextField alloc]initWithFrame:CGRectMake(100, 200, 100,50)];
    text3.text = @"确认密码";
    [self.view addSubview:text3];
    UITextField *text4 =[[UITextField alloc]initWithFrame:CGRectMake(100, 250, 100, 50)];
    text4.text = @"手机号";
    [self.view addSubview:text4];
    UITextField *text5 =[[UITextField alloc]initWithFrame:CGRectMake(100, 300, 100, 50)];
    text5.text = @"邮箱";
    [self.view addSubview:text5];
     text1.font = [UIFont fontWithName:@"Helvetica-Bold"size:22];
     text2.font = [UIFont fontWithName:@"Helvetica-Bold"size:22];
     text3.font = [UIFont fontWithName:@"Helvetica-Bold"size:22];
     text4.font = [UIFont fontWithName:@"Helvetica-Bold"size:22];
    text5.font = [UIFont fontWithName:@"Helvetica-Bold"size:22];
    UITextField *text11 = [[UITextField alloc]initWithFrame:CGRectMake(200, 100, 200, 50)];
    text11.borderStyle = UITextBorderStyleRoundedRect;
    text11.placeholder = @"请输入用户名";
   
    text11.keyboardType = UIKeyboardTypeNamePhonePad;
    text11.returnKeyType = UIReturnKeyNext;
    text11.delegate = self;
    [self.view addSubview:text11];
    UITextField *text22 = [[UITextField alloc]initWithFrame:CGRectMake(200, 150, 200, 50)];
    text22.borderStyle = UITextBorderStyleRoundedRect;
    text22.placeholder = @"请输入密码";
    text22.keyboardType = UIKeyboardTypeNamePhonePad;
    text22.returnKeyType = UIReturnKeyNext;
    text22.secureTextEntry =  YES;
    text22.delegate = self;
    [self.view addSubview:text22];
    UITextField *text33 = [[UITextField alloc]initWithFrame:CGRectMake(200, 200, 200, 50)];
    text33.borderStyle = UITextBorderStyleRoundedRect;
    text33.placeholder = @"请确认密码";
    text33.keyboardType = UIKeyboardTypeNamePhonePad;
    text33.returnKeyType = UIReturnKeyNext;
    text33.secureTextEntry =  YES;
    text33.delegate = self;
    [self.view addSubview:text33];
    
    UITextField *text44 = [[UITextField alloc]initWithFrame:CGRectMake(200, 250, 200, 50)];
    text44.borderStyle = UITextBorderStyleRoundedRect;
    text44.placeholder = @"请输入手机号";
    text44.keyboardType = UIKeyboardTypeNumberPad;
    text44.returnKeyType = UIReturnKeyNext;
    text44.delegate = self;
    [self.view addSubview:text44];
    
    UITextField *text55 = [[UITextField alloc]initWithFrame:CGRectMake(200, 300, 200, 50)];
    text55.borderStyle = UITextBorderStyleRoundedRect;
    text55.placeholder = @"请输入邮箱";
    text55.keyboardType = UIKeyboardTypeNamePhonePad;
    text55.returnKeyType = UIReturnKeyNext;
    text55.delegate = self;
   [self.view addSubview:text55];
    
}
-(BOOL)textFieldShouldReturn:(UITextField*)textField{
    
    
    [textField resignFirstResponder];
    return YES;
}
-(void)creaButtons{
    button *btton1 = [button buttonWithType:UIButtonTypeSystem withFrame:CGRectMake(150, 400, 50, 50)];
     Button1 *btton2 = [Button1 buttonWithType:UIButtonTypeSystem withFrame:CGRectMake(250, 400, 50, 50)];
    [self.view addSubview:btton1];
    [self.view addSubview:btton2];

   
    
    
    
    
    
    
}

@end
